namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0074 : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.SysTask", "Completed", c => c.Boolean(nullable: false));
            AddColumn("dbo.SysTask", "CompletedBy", c => c.Int());
            AddColumn("dbo.SysTask", "CompletedWhen", c => c.DateTime());
            DropColumn("dbo.SysTask", "AppPrcId");
            AddColumn("dbo.SysTask", "AppPrcId", c=>c.Int(defaultValue:1));
            AddForeignKey("dbo.SysTask", "AppPrcId", "dbo.SysApproveProcess", "AppPrcId", cascadeDelete: true);
            CreateIndex("dbo.SysTask", "AppPrcId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.SysTask", new[] { "AppPrcId" });
            DropForeignKey("dbo.SysTask", "AppPrcId", "dbo.SysApproveProcess");
            DropColumn("dbo.SysTask", "CompletedWhen");
            DropColumn("dbo.SysTask", "CompletedBy");
            DropColumn("dbo.SysTask", "Completed");
        }
    }
}
